<template>
    <div>
        <mb-header></mb-header>
        <nuxt />
        <join-btn @click="fnShowLogin"></join-btn>
        <login v-model="showLogin" @success="fnLoginSuccess"></login>
        <dialog-win v-model="showDialog"></dialog-win>
    </div>
</template>

<script>
import mbHeader from '@/components/common/header/mb-header'
import joinBtn from '@/components/common/join-btn'
import login from '@/components/common/login'
import dialogWin from '@/components/common/dialog'

export default {
    components: {
        mbHeader,
        joinBtn,
        login,
        dialogWin
    },
    data() {
        return {
            showLogin: false,
            showDialog: false
        }
    },
    created() {
        if (!process.server) {
            if (this.$route.query.channel) {
                this.$store.commit('userInfo/SET_SALES', {
                    channel: this.$route.query.channel,
                    platform: this.$route.query.platform
                        ? this.$route.query.platform
                        : 'mobile'
                })
            }
        }
    },
    methods: {
        fnShowLogin() {
            this.showLogin = true
        },
        fnLoginSuccess() {
            this.showLogin = false

            this.showDialog = true
        }
    }
}
</script>

<style>
html {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    word-spacing: 1px;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: border-box;
    margin: 0;
}

.button--green {
    display: inline-block;
    border-radius: 4px;
    border: 1px solid #3b8070;
    color: #3b8070;
    text-decoration: none;
    padding: 10px 30px;
}

.button--green:hover {
    color: #fff;
    background-color: #3b8070;
}

.button--grey {
    display: inline-block;
    border-radius: 4px;
    border: 1px solid #35495e;
    color: #35495e;
    text-decoration: none;
    padding: 10px 30px;
    margin-left: 15px;
}

.button--grey:hover {
    color: #fff;
    background-color: #35495e;
}
</style>
